pull: Don't save summary to cache before validating signatures
authorAlexander Larsson <alexl@redhat.com>
Tue, 3 Apr 2018 09:36:57 +0000 (11:36 +0200)
committerAtomic Bot <atomic-devel@projectatomic.io>
Tue, 3 Apr 2018 15:04:31 +0000 (15:04 +0000)
commitc4c2b5ebd155f9d17531db4ab9c2516699132745
tree0e38c9d962f883c128987165ff751992dfa99d87
parent383e375099067d55cf49c864684c4c7dba2c5ac1
pull: Don't save summary to cache before validating signatures

In case of some kind of race or other weirdness we might be getting
non-matching versions of summary.sig and summary, where summary.sig
is the latest version. Currently we're saving them to the cache
directly after downloading them successfully, but they will then fail
to gpg validate. Then on the next run we'll keep using the cached files
even if they are incorrect, until summary.sig changes upstream.

This changes the order so that we verify the signatures before saving
to the cache, thus ensuring that we don't end up in a stuck state.

Fixes https://github.com/ostreedev/ostree/issues/1523

Closes: #1529
Approved by: cgwalters
src/libostree/ostree-repo-pull.c